﻿using System;
using System.Runtime.Serialization;
using EDTS.Model.Orgnizations;

namespace EDTS.Model.Users
{
    [DataContract]
    public class UserModel:MBase
    {
        [Model(ConvertType=AttributeType.IgnoreUpdate)]
        [DataMember]
        public int UnitID { get; set; }
        [Model]
        [DataMember]
        public string UserName { get; set; }
        [Model(ConvertType=AttributeType.NotOutput)]
        [DataMember]
        public string Password { get; set; }
        [Model]
        [DataMember]
        public string RealName { get; set; }
        [Model]
        [DataMember]
        public string Mobile { get; set; }
        [Model]
        [DataMember]
        public string OfficePhone { get; set; }
        [Model]
        [DataMember]
        public string HomePhone { get; set; }
        [Model]
        [DataMember]
        public string ShortMobile { get; set; }
        [Model]
        [DataMember]
        public string Email { get; set; }
        [Model]
        [DataMember]
        public string Descript { get; set; }
        [Model]
        [DataMember]
        public int Power { get; set; }
        [Model]
        [DataMember]
        public int Sequence { get; set; }
        [Model(ConvertType = AttributeType.IgnoreUpdate)]
        [DataMember]
        public System.DateTime LastLoginTime { get; set; }
        [Model(ConvertType = AttributeType.IgnoreUpdate)]
        [DataMember]
        public int LoginTryTimes { get; set; }
        [Model(ConvertType = AttributeType.IgnoreUpdate)]
        [DataMember]
        public string WeixinID { get; set; }
        [Model(ConvertType = AttributeType.IgnoreUpdate)]
        [DataMember]
        public bool Interested { get; set; }

        #region Help
        public RoleCollection Roles { get; set; }

        public UserInGroupCollection InGroups { get; set; }

        public UnitModel Unit { get; set; }
        #endregion
    }

    [DataContract]
    public class UserCollection : ModelCollectionBase<UserModel> {}

    public class UserQuery : QueryBase
    {
        public Guid UnitGuid { get; set; }
    }
}
